# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=piow
pkgver=0.4.0
pkgrel=0
pkgdesc="Put Icons On your sway Workspaces"
url="https://github.com/KuabeM/piow"
arch="aarch64 armhf armv7 ppc64le x86 x86_64"  # blocked by rust/cargo
license="MIT OR Apache-2.0"
depends="sway"
makedepends="cargo"
source="https://github.com/KuabeM/piow/archive/v$pkgver/piow-$pkgver.tar.gz
	fix-version.patch
	"
options="!check"  # no tests provided

export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
export CARGO_PROFILE_RELEASE_LTO="true"
export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"
export CARGO_PROFILE_RELEASE_PANIC="abort"

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	cargo build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -D -m755 target/release/piow -t "$pkgdir"/usr/bin/
	install -D -m644 default.toml "$pkgdir"/etc/xdg/piow/config.toml
}

sha512sums="
d8d374aa7f9fe27dfaf73fb78144bcbf7709671a0319bbe8da07a1ec9a8c292202559d6b617601722cab269ac7a74e4dbf025053757e17b4f2781b0e6ba78b32  piow-0.4.0.tar.gz
192e586979718a32b83374982aab40420f4d923be98ae11f451c0e90ff2c6a2c8b71eb5fe95e08618376f74cc833688d53094259673ef73ce71da79e3a28693c  fix-version.patch
"
